num = int(input())
a = num % 10
num //= 10
b = num % 10
num //= 10
c = num % 10
total = a + b + c
print(total)